<template>
	<view>
		<!-- 顶部输入框 -->
		<u-search :show-action="true" action-text="搜索" :animation="false" placeholder="请输入用户备注或昵称"></u-search>
		<!-- 关注列表 -->
		<view class="focusList" v-for="(item,index) in focusList" @click="focusUserDetails(item.focusId)">
			<u-cell-group>
				<u-avatar :src="item.imagePath" size="large"></u-avatar></u-avatar>
				<u-cell-item style="float: right;width: 80%;" :title="item.userName" class="u-flex"></u-cell-item>
			</u-cell-group>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title:'关注人列表',
				//当前用户信息
				userInfo:this.$store.state.user.userInfo,
				//关注列表
				focusList:""
			}
		},
		onLoad() {
			//根据用户id查询用户关注列表
			uni.request({
			    url: this.$url + 'focus/selectFocusInfoByUserId', 
			    data: {
			        userId: this.$data.userInfo.userid
			    },
			    success: (res) => {
			        console.log("后台返回的数据：" + res.data.data);
					this.$data.focusList = res.data.data;
					//this.$store.dispatch('changeFocusList',res.data.data);
			    },
			});
		},
		methods: {
			focusUserDetails(e){
				console.log("focus-page页面传的参数：" + e)
				//跳转关注个人中心页面
				this.$u.route({
					url: "pages/person-third-page/focusUserDetails-page/focusUserDetails-page",
					params:{
						userId:e
					}
				});
				
			},
		}
	}
</script>

<style>

</style>
